home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d894.lha / AntiRascism / AntiRaBB / Source / AntiRaBB.bb.asm < prev   
Assembly Source File  |  1993-05-16  |  5KB  |  203 lines

  1.  
  2. DEBUGBOOL        =    0    (DEBUG-Modus bei TRUE an)
  3.  
  4. ;;    *****************************************************************
  5.     *    Programm:    AntiRaBB.bb                *
  6.     *            BBCode für AntiRaBB            *
  7.     *    Copyright:    PD von Hanns Holger Rutz/TropicDesign    *
  8.     *    last changez:    10.02.1993                *
  9.     *****************************************************************
  10.  
  11. ;;- Includes --------------------------
  12.  
  13.         incdir    'sys:asm/inc/'
  14.         include    'devices/trackdisk.i'
  15.         include    'exec/memory.i'
  16.         include    'exec/resident.i'
  17.         include    'hardware/custom.i'
  18.         include    'private/dos_lib.i'
  19.         include    'private/exec_lib.i'
  20.         include    'private/expansion_lib.i'
  21.         include    'private/gfx_lib.i'
  22.  
  23. ;;- Konstanten ------------------------
  24.  
  25. eb_Flags    =    34
  26. Time        =    4    Sekunden, die gewartet wird
  27. width        =    256    muß durch 32 teilbar sein
  28. height        =    29
  29. HStart        =    208    "   "     "  "       "
  30. VStart        =    150
  31. DiWStrt        =    VStart<<8!HStart
  32. DiWStop        =    (VStart+height)<<8!((HStart+width/2)&$ff)
  33. DDFStrt        =    (HStart/2-4)&$fffc
  34. DDFStop        =    (HStart/2-4)&$fffc+(width/4-8)
  35.  
  36.         rsreset
  37. cp_Color00    rs.w    2    Hintergrundfarbe
  38. cp_Color01    rs.w    2    Schriftfarbe
  39. cp_Plane0    rs.w    2*2    BitplanePointer
  40. cp_END        rs.w    2    $fffffffe
  41. cp_SIZEOF    rs.b    0
  42.  
  43. ;;- Bootblock-Header (wird von Installer init.)
  44.  
  45. *_BBHeader    dc.l    'DOS'<<8!1,0,880    (wird vom Installer init.)
  46.  
  47. ;;- Hauptprogramm ---------------------
  48. ;    In:    a1 = *TrackDiskIO, a6 = *ExecBase
  49.  
  50. _Start        movem.l    d2-d7/a2/a3/a5/a6,-(sp)
  51.         lea.l    $dff000+dmacon,a5
  52.         moveq.l    #0,d6
  53.         move.w    dmaconr-dmacon(a5),d5
  54.         move.l    #(width/8*height)+cp_SIZEOF,d4
  55.  
  56. _MotorOff    clr.l    IO_LENGTH(a1)
  57.         move.w    #TD_MOTOR,IO_COMMAND(a1)
  58.         jsr    _LVODoIO(a6)            Motor ausschalten
  59.  
  60. _GetPlane    move.l    d4,d0
  61.         moveq.l    #MEMF_CHIP!MEMF_PUBLIC,d1
  62.         jsr    _LVOAllocMem(a6)        Bitplane+CopList holen
  63.         move.l    d0,d3
  64.         beq.w    _GfxDone            ..Fehler
  65.         movea.l    d0,a3
  66.         adda.l    d4,a3                a3=EOCopList
  67.         moveq.l    #$fffffffe,d1
  68.         move.l    d1,-(a3)            CopListe-Ende
  69.         move.w    d0,-(a3)            BPl0PtL
  70.         move.w    #bplpt+$02,-(a3)
  71.         swap.w    d0
  72.         move.w    d0,-(a3)            BPl0PtH
  73.         move.w    #bplpt+$00,-(a3)
  74.         clr.w    -(a3)                Color01
  75.         move.w    #color+$02,-(a3)
  76.         clr.w    -(a3)                Color00
  77.         move.w    #color+$00,-(a3)
  78.  
  79. _OpenGfxLib    lea.l    _GfxName(pc),a1
  80.         moveq.l    #33,d0
  81.         jsr    _LVOOpenLibrary(a6)        Gfx.library öffnen
  82.         move.l    d0,d7
  83.         beq.w    _GfxDone            ..Fehler
  84.  
  85. _DecrunchGfx    lea.l    _Gfx(pc),a1
  86.         lea.l    _GfxEnd(pc),a2
  87.         movea.l    d3,a0
  88. .Loop        moveq.l    #0,d1
  89.         move.b    (a1)+,d1
  90.         blt.b    .Crunched            ..gecruncht
  91. .Loop2        move.b    (a1)+,(a0)+            ..direkt kopieren
  92.         dbf    d1,.Loop2
  93.         bra.b    .Cont
  94. .Crunched    move.b    (a1)+,d0            sich wiederholend. Byte
  95.         neg.b    d1
  96. .Loop3        move.b    d0,(a0)+            ..x-mal kopieren
  97.         dbf    d1,.Loop3
  98. .Cont        cmpa.l    a1,a2
  99.         bgt.b    .Loop                ..Schleife
  100.  
  101. _StartCopper    move.w    #%0000001110100000,(a5)
  102.         move.l    a3,cop1lc-dmacon(a5)
  103.         move.w    d6,copjmp1-dmacon(a5)
  104.         move.l    #DiWStrt<<16!DiWStop,diwstrt-dmacon(a5)
  105.         move.l    #DDFStrt<<16!DDFStop,ddfstrt-dmacon(a5)
  106.         move.l    #%1001001000000000<<16!0,bplcon0-dmacon(a5)
  107.         move.w    d6,bpl1mod-dmacon(a5)
  108.         move.w    #%1000001111000000,(a5)        alle benötigten DMAs an
  109.  
  110.         btst.b #6,$bfe001
  111.         beq.b  _ActivateStdCop            ..linker Mausknopf
  112. _Fade        move.w    #$111,d0
  113.         bsr.b    _FadeIt                einfaden
  114.         moveq.l    #Time*25-1,d2
  115.         bsr.b    _Wait                warten
  116.         neg.w    d0
  117.         bsr.b    _FadeIt                ausfaden
  118.  
  119. _ActivateStdCop    movea.l    d7,a1                GfxBase
  120.         move.w    #%0000001111000000,(a5)
  121.         move.l    gb_copinit(a1),cop1lc-dmacon(a5)    StdCopList
  122.         move.w    d6,copjmp1(a5)
  123.         ori.w    #%1000001000000000,d5
  124.         move.w    d5,(a5)                alte DMAs ein
  125.         jsr    _LVOCloseLibrary(a6)        Gfx.library schließen
  126.  
  127. _FreePlane    move.l    d4,d0
  128.         movea.l    d3,a1
  129.         jsr    _LVOFreeMem(a6)            Bitplane+Cop. freigeben
  130. _GfxDone    movem.l    (sp)+,d2-d7/a2/a3/a5/a6
  131.         ;||
  132. ;;- (Fast) normaler OS2.0 Bootblock ----------
  133. ;    In:    a6 = *ExecBase
  134.  
  135. _StdBootCode    lea.l    _ExpansionName(pc),a1
  136.         moveq.l    #37,d0
  137.         jsr    _LVOOpenLibrary(a6)
  138.         tst.l    d0
  139.         beq.b    _Quit
  140.         movea.l    d0,a1
  141.         bset.b    #6,eb_Flags(a1)        wahrscheinlich KICKBACK37
  142.         jsr    _LVOCloseLibrary(a6)
  143. _Quit        lea.l    _DOSName(pc),a1
  144.         move.w    #'do',(a1)        -> dos.library
  145.         jsr    _LVOFindResident(a6)
  146.         tst.l    d0
  147.         beq.b    _NoDOS
  148.         movea.l    d0,a0
  149.         movea.l    RT_INIT(a0),a0
  150.         moveq.l    #0,d0
  151.         rts
  152. _NoDOS        moveq.l    #-1,d0
  153.         rts
  154.  
  155. ;;- Faden -----------------------------
  156. ;    In:    d0.w = $111 (einfaden) oder -$111 (ausfaden)
  157. ;    Out:    d1/d2 = zerstört
  158.  
  159. _FadeIt        moveq.l    #15-1,d1
  160. .Loop        moveq.l    #1,d2
  161.         bsr.b    _Wait
  162.         add.w    d0,cp_Color01+2(a3)
  163.         dbf    d1,.Loop
  164.         rts
  165.  
  166. ;;- Warten ----------------------------
  167. ;    In:    d2.w = 25stel Sek. -1
  168.  
  169. _Wait
  170. .Loop        btst.b    #0,vposr+1-dmacon(a5)
  171.         beq.b    .Loop
  172. .Loop2        btst.b    #0,vposr+1-dmacon(a5)
  173.         bne.b    .Loop2
  174.         dbf    d2,.Loop
  175.         rts
  176.  
  177. ;;- Konstantenspeicher ----------------
  178.  
  179. _Gfx        incdir    'sys:asm/src/'
  180.         incbin    'AntiRa.raw'        ByteRun1-gecrunchte Bitplane
  181. _GfxEnd        odd
  182. _GfxName    dc.b    'graph'        \
  183. _DOSName    dc.b    'ics.library',0    /    <- wird zu 'dos.library'
  184.             ;^-- muß GERADE Adresse sein!
  185. _ExpansionName    EXPANSIONNAME
  186.         even
  187.  
  188. ;;- Debugstuff ------------------------
  189.  
  190.         if DEBUGBOOL
  191.           printt  'Freie Bytes:'
  192.           printv  1012-(*-_Start)
  193.         endc
  194.  
  195. ;;- Fehlerabfang ----------------------
  196.  
  197. _End        iflt 1012-(*-_Start)
  198.           fail
  199.         endc
  200.         rept    100
  201.         dc.b    'Holgi/'
  202.         endr
  203.